import requests from "./requests";

// 角色查询接口
export const selectroleAPI = (params) => {
    return requests({
        method: 'get',
        url: '/role/selectrole',
        params
    })
}
export const selectIdAPI = (params) => {
    return requests({
        method: 'get',
        url: '/role/selectId',
        params
    })
}
// 角色新增接口
export const addRoleAPI = (data) => {
    return requests({
        method: 'post',
        url: '/role/add',
        data
    })
}
// 判断角色是否唯一
export const roleGetOneAPI = (params) => {
    return requests({
        method: 'get',
        url: "/role/getOne",
        params

    })
}

// 角色删除接口
export const deleteRoleAPI = (data) => {
    return requests({
        method: 'delete',
        url: '/role/delete',
        data

    })
}
// 角色编辑接口
export const editRoleAPI = (data) => {
    return requests({
        method: 'post',
        url: '/role/edit',
        data
    })
}

// 设置角色权限接口
export const setRolePowerAPI = (params, res) => {
    return requests({
        method: 'post',
        url: '/role/setRolePower',
        params: {
            roleId: params
        },
        data: res
    })
}

